package com.example.weizix.presenter;

import android.util.Log;

import com.example.weizix.base.BasePresenter;
import com.example.weizix.bean.NewsDetailBean;
import com.example.weizix.model.NewsDetaModel;
import com.example.weizix.net.ResultCallBack;
import com.example.weizix.view.NewsDetaiView;

public class NewsDetaiPresenter extends BasePresenter<NewsDetaiView> {
    private NewsDetaModel mNewsDetailModel;

    @Override
    protected void initModel() {
        mNewsDetailModel = new NewsDetaModel();
        addModel(mNewsDetailModel);
    }

    public void getNewsDetail(int newsId) {
        mNewsDetailModel.getNewsDetail(newsId, new ResultCallBack<NewsDetailBean>() {
            @Override
            public void onSuccess(NewsDetailBean newsDetailBean) {
                view.setData(newsDetailBean);
                Log.i("Tag",""+newsDetailBean.toString());
            }

            @Override
            public void onFail(String msg) {
                Log.d("Tag",""+msg);
            }
        });
    }
}
